home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / VIS082S.ARJ / CONVERT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-03  |  13KB  |  376 lines

  1. Program Celerity_To_Vision_Convert;
  2.  
  3. { Written by: The Elemental }
  4. { There's no stop'n US! }
  5.  
  6. Uses Gentypes,Configrt,Crt;
  7.  
  8. Type CELConfType=(lowerc,eightyc,linef,postp,morep,asciig,ansig,udsys,bulletinsys,
  9.                   votingsys,emailsys,doorssys,mainsys,databasesys,NewUserSys,
  10.                   gfsys,want,showt,vt522,fsedit);
  11.      CELFListType=(ffname,ffext,fffulnam,ffofwhat,ffsize,ffpoints,ffuploader,
  12.                    ffuploaded,ffdown,ffdescript);
  13.      NuvSet = set of 1..255;
  14.  
  15.      CELURec = Record
  16.        Handle,RealName,Note:MStr;
  17.        Macro1,Macro2,Macro3:LStr;
  18.        Password:Sstr;
  19.        PhoneNum:String[12];
  20.        Laston:Longint;
  21.        Numon,TimeToday,Nup,Ndn,Nbu,Uploads,Downloads:Integer;
  22.        TotalTime:Real;
  23.        Voted:Array [1..5] of Byte;
  24.        UdLevel,UdPoints,Level,EmailAnnounce,BeepedPwd:Integer;
  25.        Infoforms:array [1..5] of Integer;
  26.        RegularColor,PromptColor,StatColor,InputColor,FifthColor,SixthColor,
  27.        SeventhColor,EighthColor,DisplayLen:Byte;
  28.        LastMessages,LastUps,LastGfiles,LastDBases,Integer1:Integer;
  29.        DownK,UpK:Longint;
  30.        GFLevel,GfUploads,GFDownloads:Integer;
  31.        MenuType,Byte1:Byte;
  32.        DefProto,Char1:Char;
  33.        Hack:Byte;
  34.        Config:Set of CELConfType;
  35.        NewScanConfig,Access1,Access2:Set of Byte;
  36.        TimeinStorage:Word;
  37.        LastRead:Array [0..20,1..5] of Word;
  38.        ConfAccess:Array [0..5] of Boolean;
  39.        LastCps,CpsTimes:Word;
  40.        FileList:Set of CELFListType;
  41.        CommPoints,ValPoints:Integer;
  42.        ScanNet:Boolean;
  43.        QuikConf:Array [1..5] of Boolean;
  44.        UserPcr,UserUdr,Age:Byte;
  45.        UserSex:Boolean;
  46.        VoteYes,VoteNo,TimePerDay:Byte;
  47.      End;
  48.  
  49.      visconfig=(lowercas,eightycol,linefeed,postprompt,moreprompt,
  50.                 asciigraphic,ansigraphic,udsyso,bulletinsyso,votingsyso,
  51.                 emailsyso,doorssysop,mainsyso,databasesyso,wante,
  52.                 showtim,vt5,fsedito);
  53.  
  54.  
  55.      visrec=record
  56.        handle,              (* Users Handle *)
  57.        realname:mstr;       (* Users Real Name *)
  58.        password:sstr;       (* Users Password *)
  59.        phonenum:string[10]; (* Users Phone Number *)
  60.        laston:longint;      (* Last Call date in DATEPACK form *)
  61.        numon,               (* Total Calls *)
  62.        timetoday,           (* Time left today *)
  63.        nup,                 (* G-File Uploads *)
  64.        ndn,                 (* G-File Downloads *)
  65.        nbu,                 (* Messages posted *)
  66.        uploads,             (* Uploads *)
  67.        downloads:integer;   (* Downloads *)
  68.        totaltime:real;      (* Total Time spent on system by user *)
  69.        voted:voteset;       (* What the user voted on *)
  70.        udlevel,             (* File Level *)
  71.        udpoints,            (* File Points *)
  72.        level,               (* Main Access Level *)
  73.        emailannounce,       (* Sector for Email Announcement "-1" if none *)
  74.        beepedpwd,           (* Reserved *)
  75.        infoform,            (* Location for Infoform #1 *)
  76.        glevel,              (* G-File Level *)
  77.        gpoints:integer;     (* G-File Points *)
  78.        regularcolor,        (* The following are the users colors. *)
  79.        promptcolor,
  80.        statcolor,
  81.        inputcolor,
  82.        displaylen,
  83.        menuboard,
  84.        menuback,
  85.        blowboard,
  86.        blowinside:byte;
  87.        config:set of visconfig;   (* Various config stuff, i.e. Ansi, etc *)
  88.        newscanconfig,              (* Various stuff dealing with message
  89.                                       bases. Do not mess with these. *)
  90.        access1,
  91.        access2:set of byte;
  92.        usernote,                   (* Account Note [Public] *)
  93.        macro1,                     (* Predefined user macros *)
  94.        macro2,
  95.        macro3:mstr;
  96.        upkay,                      (* Upload K *)
  97.        dnkay:longint;              (* Download K *)
  98.        lastbaud,                   (* Last baud rate used *)
  99.        lastlevel,                  (* Last main access level *)
  100.        lastxfer,                   (* Last File Level *)
  101.        lastxferpts:integer;        (* Last File Points *)
  102.        confset:conferenceset;      (* Array [1..32] of byte for the
  103.                                       sub-conferences *)
  104.        hackattempts:integer;       (* Password Hack Attempts *)
  105.        revision:integer;           (* Last Revision Number *)
  106.        lastposts,                  (* Last total messages in system *)
  107.        lastfiles:word;             (* Last total files in system *)
  108.        infoform2,                  (* Location of Infoforms 2-5 *)
  109.        infoform3,
  110.        infoform4,
  111.        infoform5:integer;
  112.        lastread:array [0..255] of word;        (* Message Stuff *)
  113.        expdate:longint;             (* Expiration date in DATEPACK form *)
  114.        timebank:integer;            (* Time stored in Time Bank *)
  115.        lastcalno:word;              (* Last Caller Number *)
  116.        udratio,                     (* Individual Upload/Download Ratio *)
  117.        udkratio,                    (* Individual U/D K Ratio *)
  118.        pcratio:integer;             (* Individual Post/Call Ratio *)
  119.        avatar:byte;                 (* 0=Normal ansi, 1=Pull Down Windows,
  120.                                        2=Avatar (not implemented yet) *)
  121.        timelimits:integer;          (* Daily time limit (0 means normal) *)
  122.        Conf:Array [1..5] of Boolean;   (* Main Conference Flags *)
  123.        LastConf:Byte;                  (* Last Conference user was in *)
  124.        SpecialSysopNote:Mstr;          (* Special Sysop Note *)
  125.        MenuHighlight,statusboxcolor:Byte;
  126.        LastGfiles:Word;
  127.        prompttype:integer;
  128.        NewVoteYes,NewVoteNo:integer;
  129.        newvoteit:array [1..30] of integer;
  130.        nuv1,nuv2,nuv3,nuv4,nuv5,nuv6,nuv7,nuv8,nuv9,nuv10:lstr;
  131.        use1,use2,use3,use4,use5,use6,use7,use8:BooLean;
  132.   end;
  133.  
  134.  
  135.  
  136. Procedure CelerityUserConvert;
  137. Var UFile:File of CELURec;
  138.     CEL:CELURec;
  139.     VFile:File of UserRec;
  140.     VIS:UserRec;
  141.     Cnt,I:Integer;
  142. Begin
  143.   Writeln ('Converting: Celerity User List to Vision Format!');
  144.   Assign (UFile,'USERS');       { Open And Rename Celerity Users File }
  145.   Reset (UFile);
  146.   If IOResult <> 0 Then Begin
  147.     Writeln ('File: USERS not found.. Cannot continue!');
  148.     Close (UFile);
  149.     Exit
  150.   End;
  151.   Rename (UFile,'USERS.CEL');
  152.   Assign (VFile,'USERS.');      { Open and Create Vision Users File }
  153.   Rewrite (VFile);
  154.   Seek (UFile,1);
  155.   Seek (VFile,0);
  156.   Cnt:=0;
  157.   TextAttr:=11;
  158.   VIS.Handle:='';
  159.   While Not Eof(UFile) Do Begin
  160.     Read (UFile,CEL);
  161.     For I:=1 to Length(VIS.Handle) Do
  162.      Write (#8#32#8);
  163.     FillChar (VIS,SizeOf(VIS),0);
  164.     If Length(CEL.Handle) > 0 Then Begin
  165.       Cnt:=Cnt + 1;
  166.       Write (VIS.Handle);
  167.       VIS.Handle:=CEL.Handle;
  168.       VIS.RealName:=CEL.RealName;
  169.       VIS.UserNote:=CEL.Note;
  170.       VIS.Macro1:=CEL.Macro1;
  171.       VIS.Password:=CEL.Password;
  172.       VIS.PhoneNum:=Copy(CEL.PhoneNum,1,3) + Copy(CEL.PhoneNum,5,3) +
  173.                     Copy(CEL.PhoneNum,9,4);
  174.       VIS.Level:=CEL.Level;
  175.       VIS.Numon:=CEL.Numon;
  176.       VIS.NBu:=CEL.NBu;
  177.       VIS.UdLevel:=CEL.UdLevel;
  178.       VIS.UdPoints:=CEL.UdPoints;
  179.       VIS.Uploads:=CEL.Uploads;
  180.       VIS.Downloads:=CEL.Downloads;
  181.       VIS.RegularColor:=CEL.RegularColor;
  182.       VIS.StatColor:=CEL.StatColor;
  183.       VIS.InputColor:=CEL.InputColor;
  184.       VIS.PromptColor:=CEL.PromptColor;
  185.       VIS.MenuBoard:=CEL.FifthColor;
  186.       VIS.MenuBack:=CEL.SixthColor;
  187.       VIS.MenuHighLight:=CEL.SeventhColor;
  188.       VIS.DisplayLen:=CEL.DisplayLen;
  189.       VIS.BlowInside:=7;
  190.       VIS.BlowBoard:=7;
  191.       VIS.StatusBoxColor:=7;
  192.  
  193.       VIS.Config:=[LowerCase,LineFeeds,AnsiGraphics,AsciiGraphics,Fseditor,
  194.                    EightyCols];
  195.       Seek (VFile,Cnt - 1);
  196.       Write (VFile,VIS);
  197.     End;
  198.   End;
  199.   Writeln (Cnt,' Users Converted over to Vision!');
  200.   If Cnt > 70 Then Writeln ('Ahh.. Busy Day!!');
  201.   Close (UFile);
  202.   Close (VFile);
  203. End;
  204.  
  205. Procedure ViSiONUserConvert;
  206. Var UFile:File of VisRec;
  207.     OLD:VisRec;
  208.     VFile:File of UserRec;
  209.     VIS:UserRec;
  210.     Wow,Cnt,I:Integer;
  211. Begin
  212.   Writeln ('Converting: ViSiON User List to Vision Format!');
  213.   Assign (UFile,'USERS');       { Open And Rename Celerity Users File }
  214.   Reset (UFile);
  215.   If IOResult <> 0 Then Begin
  216.     Writeln ('File: USERS not found.. Cannot continue!');
  217.     Close (UFile);
  218.     Exit;
  219.   End;
  220.   Rename (UFile,'USERS.VIS');
  221.   Assign (VFile,'USERS.');      { Open and Create Vision Users File }
  222.   Rewrite (VFile);
  223.   Seek (UFile,0);
  224.   Seek (VFile,0);
  225.   Cnt:=0;
  226.   TextAttr:=11;
  227.   VIS.Handle:='';
  228.   While Not Eof(UFile) Do Begin
  229.     Read (UFile,OLD);
  230.     For I:=1 to Length(VIS.Handle) Do
  231.      Write (#8#32#8);
  232.     FillChar (VIS,SizeOf(VIS),0);
  233.       Cnt:=Cnt + 1;
  234.       Gotoxy(1,12);
  235.       Write('                                             ');
  236.       Gotoxy(1,12);
  237.       Write('Converting: '+OLD.HANDLE);
  238.       Write (VIS.Handle);
  239.       VIS.Handle:=OLD.Handle;
  240.       VIS.RealName:=OLD.RealName;
  241.       VIS.UserNote:=OLD.UserNote;
  242.       VIS.Password:=OLD.Password;
  243.       VIS.PhoneNum:=OLD.PhoneNum;
  244.       VIS.Level:=OLD.Level;
  245.       VIS.Numon:=OLD.Numon;
  246.       VIS.NBu:=OLD.NBu;
  247.       Vis.laston:=Old.laston;
  248.       VIS.UdLevel:=OLD.UdLevel;
  249.       VIS.UdPoints:=OLD.UdPoints;
  250.       VIS.Uploads:=OLD.Uploads;
  251.       VIS.Downloads:=OLD.Downloads;
  252.       VIS.RegularColor:=OLD.RegularColor;
  253.       VIS.StatColor:=OLD.StatColor;
  254.       VIS.InputColor:=OLD.InputColor;
  255.       VIS.PromptColor:=OLD.PromptColor;
  256.       VIS.MenuBoard:=OLD.MenuBoard;
  257.       VIS.MenuBack:=OLD.MenuBack;
  258.       VIS.MenuHighLight:=OLD.MenuHighLight;
  259.       VIS.DisplayLen:=OLD.DisplayLen;
  260.       VIS.BlowInside:=OLD.BlowInside;
  261.       VIS.BlowBoard:=OLD.BlowBoard;
  262.       VIS.StatusBoxColor:=7;
  263.       VIS.usernote:=old.usernote;
  264.       VIS.macro1:=old.macro1;
  265.       VIS.macro2:=old.macro2;
  266.       VIS.macro3:=old.macro3;
  267.       VIS.timetoday:=Old.Timetoday;
  268.       VIS.upkay:=old.upkay;
  269.       VIS.dnkay:=old.dnkay;
  270.       VIS.lastbaud:=old.lastbaud;
  271.       VIS.lastlevel:=old.lastlevel;
  272.       VIS.lastxfer:=old.lastxfer;
  273.       VIS.lastxferpts:=old.lastxferpts;
  274.       VIS.confset:=old.confset;
  275.       VIS.hackattempts:=old.hackattempts;
  276.       VIS.revision:=old.revision;
  277.       VIS.lastposts:=old.lastposts;
  278.       VIS.lastfiles:=old.lastfiles;
  279.       VIS.infoform2:=old.infoform2;
  280.       VIS.infoform3:=old.infoform3;
  281.       VIS.infoform4:=old.infoform4;
  282.       VIS.infoform5:=old.infoform5;
  283. (*      For Wow:=1 to 255 Do Begin
  284.        VIS.lastread[wow]:=old.lastread[wow];
  285.       End;
  286.       For Wow:=1 to 32 Do Begin
  287.        VIS.conf[wow]:=OLD.conf[wow];
  288.       End; *)
  289.       VIS.expdate:=old.expdate;
  290.       VIS.timebank:=old.timebank;
  291.       VIS.lastcalno:=old.lastcalno;
  292.       VIS.udratio:=old.udratio;
  293.       VIS.udkratio:=old.udkratio;
  294.       VIS.pcratio:=old.pcratio;
  295.       VIS.avatar:=old.avatar;
  296.       VIS.timelimits:=old.timelimits;
  297. (*      For Wow:=1 to 5 Do Begin
  298.        VIS.Conf[wow]:=Old.conf[wow];
  299.       End; *)
  300.       VIS.LastConf:=old.lastconf;
  301.       VIS.SpecialSysopNote:=Old.SpecialSysopNote;
  302.       VIS.prompttype:=Old.prompttype;
  303.       VIS.NewVoteYes:=Old.NewVoteYes;
  304.       Vis.NewVoteNo:=old.NewVoteNo;
  305. (*      For Wow:=1 to 30 Do Begin
  306.        VIS.newvoteit[wow]:=Old.newvoteit[wow];
  307.       End; *)
  308.       VIS.nuv1:=Old.nuv1;
  309.       Vis.nuv2:=Old.nuv2;
  310.       Vis.nuv3:=Old.nuv3;
  311.       Vis.nuv4:=Old.nuv4;
  312.       Vis.nuv5:=Old.nuv5;
  313.       vis.nuv6:=old.nuv6;
  314.       vis.nuv7:=old.nuv7;
  315.       Vis.nuv8:=Old.nuv8;
  316.       vis.nuv9:=old.nuv9;
  317.       vis.nuv10:=Old.nuv10;
  318.       VIS.use1:=Old.use1;
  319.       Vis.use2:=old.use2;
  320.       vis.use3:=old.use3;
  321.       vis.use4:=old.use4;
  322.       vis.use5:=old.use5;
  323.       vis.use6:=old.use6;
  324.       vis.use7:=old.use7;
  325.       vis.use8:=old.use8;
  326.       VIS.yourprompt:='';
  327.       Vis.msgheader:=3;
  328.       VIS.Config:=[LowerCase,LineFeeds,AnsiGraphics,AsciiGraphics,Fseditor,
  329.                    EightyCols];
  330.       Write (VFile,VIS);
  331.   End;
  332.   WRiteLn;
  333.   Writeln (Cnt,' Users Converted over to Vision!');
  334.   If Cnt > 70 Then Writeln ('Ahh.. Busy Day!!');
  335.   Close (UFile);
  336.   Close (VFile);
  337. End;
  338.  
  339. Var K:Char;
  340. Begin
  341.   ReadConfig;
  342.   TextAttr:=7;
  343.   ClrScr;
  344.   TextAttr:=12;
  345.   Write (#13#10#13#10'Celerity/old ViSiON to ');
  346.   TextAttr:=13;
  347.   Write ('ViSiON ');
  348.   TextAttr:=12;
  349.   Writeln ('User Converter!');
  350.   TextAttr:=9;
  351.   Writeln ('Written by: The Elemental - ViSiON Programming Staff Member');
  352.   TextAttr:=10;
  353.   Writeln ('(C)opyright 1991 Ruthless Enterprises!!');
  354.   Writeln;
  355.   TextAttr:=12;
  356.   Repeat
  357.    Write ('Continue with Conversion [y/N]? ');
  358.    K:=Upcase(ReadKey);
  359.   Until K in [#13,'Y','N'];
  360.   TextAttr:=11;
  361.   Repeat
  362.    Write (#13#10'Convert Celerity or ViSiON [C/V]? ');
  363.    K:=Upcase(ReadKey);
  364.    textattr:=14;
  365.   Until K in ['C','V'];
  366.   If K = 'C' Then Begin
  367.     CelerityUserConvert;
  368.     WriteLn;
  369.     Writeln ('Celerity Users List Saved as USERS.CEL');
  370.   End Else
  371.   If K = 'V' Then Begin
  372.     ViSiONUserConvert;
  373.     Writeln;
  374.     Writeln ('ViSiON Old Users List Saved as USERS.VIS');
  375.   End;
  376. End.